﻿<?php require_once("includes/session.php"); ?>
<?php confirm_logged_in(); ?>
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php access_check(1,$connection); ?>
<?php include("includes/header.php"); ?>

<?php 
	

	
?>

<article>
	<h2>Vartotojai</h2>
	
	
  <form autocomplete="off" action="permitions.php" method="post" >
	<table  border="0">
	<?php 
	$sql = "SELECT * ";
	$sql .= " FROM `vartotojas`, `personalas`";
	$sql .= " WHERE `vartotojas`.`personalasid`=";
	$sql .= " `personalas`.`personalasid`";
	$sql .= " ORDER BY `pavarde`ASC";

	$vartotojas_set = mysql_query($sql, $connection);
	while ($vartotojas = mysql_fetch_assoc($vartotojas_set)){
	echo "<tr>";
	echo "<td>";
	echo $vartotojas['vardas']." ".$vartotojas['pavarde'];
	echo "</td>";
	echo "<td>";
	echo "<a href=\"permitions.php?vartid=";
	echo $vartotojas['vartotojasid'];
	echo "\">Teises</a>";
	echo "</td>";
	echo "</tr>";
	
	};
	?>


  
</table>
					  </form>
</article>
				
            
<?php require("includes/footer.php"); ?>